/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Foundation Framework
 * Version 2.10
 * 
 * Stored Procedure Collection Class
 *      Provides a custom collection class for storing StoredProcedureBase objects.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
using System;

namespace Adaptive.Foundation.Data
{
    /// <summary>
    /// Provides a custom collection class for storing <see cref="StoredProcedureBase"/> objects.
    /// </summary>
    public sealed class StoredProcedureCollection : GenericCollectionBase<StoredProcedureBase>
    {
        /*--------------------------------------------------------------------------------
         * Constructor / Dispose / Destructor Methods
		 *------------------------------------------------------------------------------*/
        #region Constructor / Dispose / Destructor Methods
        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        /// <remarks>
        /// This is the default constructor.
        /// </remarks>
        public StoredProcedureCollection()
            : base()
        {
        }
        #endregion

        /*--------------------------------------------------------------------------------
         * Protected Methods / Functions / Overrides
		 *------------------------------------------------------------------------------*/
        #region Protected Methods / Functions / Overrides
        /// <summary>
        /// Queries the implementing class to provide the key value for the specific 
        /// object instance.
        /// </summary>
        /// <param name="itemToGetKeyFor">
        /// The object instance to store in the collection for which a key is needed.
        /// </param>
        /// <returns>
        /// The key value to associate with the object once stored in the collection.
        /// </returns>
        protected override string GetKeyForObject(StoredProcedureBase itemToGetKeyFor)
        {
            if (itemToGetKeyFor != null)
                return itemToGetKeyFor.Name;
            else
                return string.Empty;
        }
        #endregion
    }
}